package com.caoustc.okhttplib.okhttp

import com.caoustc.okhttplib.okhttp.platform.Stat
import java.lang.reflect.Type

open class BaseHttpRequestCallback<T> {
    @kotlin.jvm.JvmField
    var baseRequestType: Type?
    @kotlin.jvm.JvmField
    var baseDataType: Type? = null
    open fun onStart() {}

    open fun onFinish() {}
    open fun onSuccess(data: T) {}
    open fun onSuccess(data: T, stat: Stat?) {}
    open fun onSuccessError(resultCode: String?, errorMessage: String?) {}
    open fun onSuccessError(stat: Stat?) {}
    open fun onSuccess(data: T, total: Int?) {}
    open fun onSuccess(data: T, stat: Stat?, total: Int?) {}
    open fun onProgress(progress: Int, networkSpeed: Long, done: Boolean) {}
    open fun onFailure(errorCode: Int, msg: String?) {}
    //protected Headers headers;
    init {
        baseRequestType = ClassTypeReflect.getModelClazz(javaClass)
    }
}